import { app, shell, BrowserWindow , ipcMain } from 'electron'
import store from './store'



const handleLoginOrRegister = (callBack) => {
  ipcMain.on('handleLoginOrRegister', (e , isLogin) => {
    callBack(isLogin)
  })
}

const onOpenChat = (callBack) => {
  ipcMain.on('openChat', (e , data) => {

    store.set('userId' , data.userId)
    store.set('userInfo' , data)
    callBack(data)
  })
}


const onOperateWindow = (callBack) => {
  ipcMain.on('operateWindow', (e , data) => {
    callBack(e , data)
  })
}

export {
  handleLoginOrRegister,
  onOpenChat,
  onOperateWindow
}
